/* $Id: osdep.c,v 1.1 2004/11/14 09:06:42 sby Exp $ */

#include "bbs.h"

void (*bsd_signal(int sig, void (*func)(int)))(int)
{
  struct sigaction act, oact;

  act.sa_handler = func;
  act.sa_flags = SA_RESTART;
  sigemptyset(&act.sa_mask);
  sigaddset(&act.sa_mask, sig);

  if (sigaction(sig, &act, &oact) == -1)
    return(SIG_ERR);

  return(oact.sa_handler);
}

